package com.lxlg.lxlg_order.client;

import com.lxlg.core.utils.Result;
import com.lxlg.lxlg_order.client.param.CancelSeckillOrderForm;
import com.lxlg.lxlg_order.client.param.PaySeckillOrderForm;
import com.lxlg.lxlg_order.client.param.SeckillOrderForm;
import com.lxlg.lxlg_order.client.result.SeckillOrderInfo;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;

/**
 * name是项目名，contextId是client的名字
 */
@FeignClient(contextId = "seckillOrderClient",name="orderservice")
@RequestMapping("/orderservice/infra/membership-levels")
public interface SeckillOrderClient {
    @PostMapping("newSeckillOrder")
    public Result<SeckillOrderInfo> newSeckillOrder(@RequestBody @Valid SeckillOrderForm seckillOrderForm);

    @PostMapping("cancelSeckillOrder")
    public Result<String> cancelSeckillOrder(@RequestBody @Valid CancelSeckillOrderForm cancelSeckillOrderForm);

    @PostMapping("paySeckillOrder")
    public void paySeckillOrder(@RequestBody @Valid PaySeckillOrderForm paySeckillOrderForm) ;

}
